
import $app from '../$app'// 公共方法

export default {
  /*region ****************************商标查询/检索*********************************/
  // 商标检索
  lb_getTmSearch (obj, success) {
    $app.postAjax('tm/search', obj, res=>{
      success(res.data);
    })
  },
  // 商标详情
  lb_getTmInfo (obj,success) {
    $app.postAjax('tm/searchInfo',obj,success)
  },
  // 购买分析报告
  lb_getTmReportBuy (obj,success) {
    $app.postAjax('tmReport/buy',obj,success);
  },
  // 分析报告详情
  lb_getTmReportInfo(obj,success) {
    $app.postAjax('tmReport/info',obj,success);
  },
  // 商标搜索
  lb_getTmQuery (obj,success,fail) {
    $app.postAjax('tm/query',obj,res=>{
      success(res.data);
    },()=>{
      fail instanceof Function && fail();
    });
  },
  // 商标图形检索
  lb_getImgSearch (obj, success) {
    $app.postAjax('tm/imgSearch', obj, success)
  },
  /*endregion*/





  /*region***************************商标管理*****************************/
  // 商标一键导入
  lb_getImportByAgent(agent_name,success,fail) {
    $app.postAjax('tmManage/importByAgent',{
      agent_name
    },success,fail);
  },
  // 商标申请号导入
  lb_getImportByRegisterNum (register_number,success,fail) {
    $app.postAjax('tmManage/importByRegisterNum',{
      register_number
    },success,fail);
  },
  // 商标申请人导入
  lb_getImportByRegPeople (reg_people_name,success) {
    $app.postAjax('tmManage/importByRegPeople',{
      reg_people_name
    },success);
  },
  // 商标文件导入
  lb_getImportByFile (obj,success) {
    $app.postAjax('tmManage/importByFile',obj,success);
  },

  // 商标申请人模糊查询
  lb_getQueryRegPeople (obj,success,fail) {
    $app.postAjax('tmManage/queryRegPeople',obj,res=>{
      success(res.data);
    },()=>{
      fail instanceof Function && fail();
    });
  },
  // 商标代理机构模糊查询
  lb_getQueryAgent (obj,success,fail) {
    $app.postAjax('tmManage/queryAgent',obj,res=>{
      success(res.data);
    },()=>{
      fail instanceof Function && fail();
    });
  },
  
  
  //专利文件导入
  lb_wrcRXx (obj,success) {
    $app.postAjax('patentManage/importByFile',obj,success);
  },
  // 专利一键导入
  lb_get_importByAgent(agent_name,success,fail) {
    $app.postAjax('patentManage/importByAgent',{
      agent_name
    },success,fail);
  },
  // 根据专利号导入
  lb_get_importByApplyNumber(patent_apply_number,success,fail) {
    $app.postAjax('patentManage/importByApplyNumber',{
      patent_apply_number
    },success,fail)
  },
  // 根据申请人名称导入专利
  lb_get_importByRegPeople(patent_applicant_one,success) {
    $app.postAjax('patentManage/importByRegPeople',{
      patent_applicant_one
    },success)
  },
  
  // 企业数据管理数量统计
  lb_get_dataManageCount(obj,success) {
    $app.postAjax('partner/dataManageCount',obj,success)
  },
  /*endregion*/

  
  /*region***************************我的钱包*****************************/
  // 企业流程记录
  lb_getPartnerloWater(obj,success) {
    $app.showLoading = false;
    $app.postAjax('partner/floWater',obj,success);
  },
  /*endregion*/

  //可开票流水列表
  wrctYn(obj,success) {
    $app.showLoading = false;
    $app.postAjax('partner/billFloWater',obj,success);
  },
  


  //记录开票记录
  wecTlist(obj,success) {
    $app.showLoading = false;
    $app.postAjax('partner/billList',obj,success);
  },


  //申请开票
  goKaiP(success){
    $app.postAjax('partner/bill',{},res=>{
      $app.toast('申请开票成功',true);
      success(res);
    });
  },


  /*region***************************修改邮箱*****************************/

  //修改邮箱
  lb_getSendEmail (email,code,that,success) {
    $app.postAjax('partner/sendEmail',{
      email,
      code
    },(res)=>{
      $app.toast(res.msg,true,()=>{
        success();
      });
    },(res)=>{
      $app.failFocus(res,that);
    });
  },
  /*endregion*/

  /*region***************商标 客户线索************** */
  // 申请线索
  lb_getClue(success) {
    $app.postAjax('clue/getClue',{},success);
  },
  // 客户线索列表
  lb_getClueList(obj,success) {
    $app.postAjax('clue/clueList',obj,success);
  },
  // 线索详情
  lb_getClueInfo(obj,success) {
    $app.postAjax('clue/info',obj,success);
  },
  // 添加客户沟通记录
  lb_getClueContactLog(obj,success) {
    $app.postAjax('clue/addContactLog',obj,success);
  },
  // 成交线索
  lb_getClueFinish(obj,success) {
    $app.postAjax('clue/finish',obj,success);
  },
  // 认领线索
  lb_getClueReceive(obj,success) {
    $app.postAjax('clue/receive',obj,success);
  },
  // 删除客户和线索
  lb_getClueDelCustomer(obj,success) {
    $app.postAjax('clue/delCustomer',obj,success);
  },
  // 获取线索数量
  lb_getClueCount(obj,success) {
    $app.postAjax('clue/count',obj,success);
  },
  // 已成交的线索列表
  lb_getClueFinishList(obj,success) {
    $app.postAjax('clue/finishClueList',obj,success);
  },
  /*endregion*/


  /*region***************专利 客户线索***************/
  // 客户线索列表
  lb_getPatentClueList(obj,success) {
    $app.postAjax('patentClue/clueList',obj,success);
  },
  // 获取线索数量
  lb_getPatentClueCount(obj,success) {
    $app.postAjax('patentClue/clueCount',obj,success);
  },
  // 申请线索
  lb_getPatentClue(success) {
    $app.postAjax('patentClue/applyClue',{},success);
  },
  // 认领线索
  lb_getPatentClueReceive(clue_id,success) {
    $app.postAjax('patentClue/receive',{clue_id},success);
  },

  // 一键认领 线索
  lb_getPatentClueReceiveAll(success) {
    $app.postAjax('patentClue/receiveAll',{},success);
  },

  // 删除客户和线索
  lb_getPatentClueDel(clue_id,success) {
    $app.postAjax('patentClue/del',{clue_id},success);
  },
  // 成交线索
  lb_getPatentClueFinish(clue_id,success) {
    $app.postAjax('patentClue/finish',{clue_id},success);
  },
  // 线索详情
  lb_getPatentClueInfo(clue_id,success) {
    $app.postAjax('patentClue/clueInfo',{clue_id},success);
  },
  // 添加客户沟通记录
  lb_getPatentClueContactLog(obj,success) {
    $app.postAjax('patentClue/addContactLog',obj,success);
  },

  /*endregion*/








  /*region 提现中心*/
  // 申请提现
  lb_getWithdrawal(obj,success) {
    $app.postAjax('partner/withdrawal',obj,success);
  },
  // 收益记录
  lb_getProfitList(obj,success) {
    $app.showLoading = false;
    $app.postAjax('partner/profitList',obj,success);
  },
  // 提现申请列表
  lb_getWithdrawalList(obj,success) {
    $app.showLoading = false;
    $app.postAjax('partner/withdrawalList',obj,success);
  },
  /*endregion*/

  /*region 下级会员列表*/
  // 下级会员列表
  lb_getPartnerInviteList(obj,success) {
    $app.postAjax('partner/inviteList',obj,success);
  },
  /*endregion*/








  /*region 专利检索*/
  // 搜索
  lb_getPatentSearch(obj,success) {
    $app.postAjax('patent/search',obj,success);
  },
  // 详情
  lb_getPatentSearchInfo(obj,success) {
    $app.postAjax('patent/searchInfo',obj,success);
  },
  // 说明书内容
  lb_getInstructionContent(obj,success) {
    $app.postAjax('patent/getInstructionContent',obj,success);
  },
  // 权利要求数据
  lb_getClaimsContent(obj,success) {
    $app.postAjax('patent/getClaimsContent',obj,success);
  },
  // 模糊查询第一申请人
  lb_queryApplicantOne(obj,success,fail) {
    $app.postAjax('patent/queryApplicantOne',obj,res=>{
      success(res.data);
    },()=>{
      fail instanceof Function && fail();
    });
  },
  // 模糊查询代理人
  lb_queryAgent(obj,success,fail) {
    $app.postAjax('patent/queryAgent',obj,res=>{
      success(res.data);
    },()=>{
      fail instanceof Function && fail();
    });
  },
  // 模糊查询代理人
  lb_queryAgent_cy(obj,success,fail) {
    $app.postAjax('patent/queryAgency',obj,res=>{
      success(res.data);
    },()=>{
      fail instanceof Function && fail();
    });
  },

  /*endregion*/
}
